package com.adinnet.admin.bootPage.service.impl;

import com.adinnet.admin.bootPage.model.BootPage;
import com.adinnet.admin.bootPage.mapper.BootPageMapper;
import com.adinnet.admin.bootPage.service.BootPageService;
import com.adinnet.admin.content.model.Content;
import com.adinnet.common.utils.StringUtil;
import com.adinnet.core.PageParam;
import com.adinnet.core.PageResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 启动页表 服务实现类
 * </p>
 *
 * @author chenjia
 * @since 2021-03-03
 */
@Service
public class BootPageServiceImpl extends ServiceImpl<BootPageMapper, BootPage> implements BootPageService {

    @Override
    public PageResult<BootPage> bootPageList(PageParam req) {
        Page<BootPage> iPage = new Page<>(req.getPage(), req.getLimit());
        QueryWrapper<BootPage> queryWrapper = new QueryWrapper<>();
        IPage page = baseMapper.selectPage(iPage, queryWrapper);
        return new PageResult<BootPage>(page.getRecords(),page.getTotal());
    }
}
